package com.ssy.lingxi.member.merchant.controller.web;

import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.member.merchant.model.vo.basic.request.OrganizationPageVO;
import com.ssy.lingxi.member.merchant.model.vo.basic.response.MemberRegisterTagVO;
import com.ssy.lingxi.member.merchant.model.vo.basic.response.MemberRightScoreVO;
import com.ssy.lingxi.member.merchant.model.vo.basic.response.UserDetailVO;
import com.ssy.lingxi.member.merchant.model.vo.maintenance.response.MemberOrganizationQueryVO;
import com.ssy.lingxi.member.merchant.model.vo.manage.request.MemberAndRoleIdVO;
import com.ssy.lingxi.member.merchant.service.web.IMemberCommonBusinessService;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @menu 会员业务能力其他接口
 * @author 万宁
 * @version 2.0.0
 * @date 2020-10-23
 */
@RestController
@RequestMapping("/member/business")
public class MemberCommonBusinessController {

    @Resource
    private IMemberCommonBusinessService memberCommonBusinessService;

    /**
     * “积分兑换支付” - 查询会员平台通用和专有账户权益积分
     * @param headers Http头部信息
     * @param idVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/lrc/right/point/get", method = RequestMethod.GET)
    public Wrapper<MemberRightScoreVO> getMemberRightPoint(@RequestHeader HttpHeaders headers, @Valid MemberAndRoleIdVO idVO) {
        return memberCommonBusinessService.getMemberRightPoint(headers, idVO);
    }

    /**
     * “电子签章 - 企业认证” - 查询会员注册资料
     * @param headers Http头部信息
     * @return 查询结果
     */
    @RequestMapping(value = "/detail/tag/get", method = RequestMethod.GET)
    public Wrapper<MemberRegisterTagVO> getMemberRegisterTagDetail(@RequestHeader HttpHeaders headers) {
        return memberCommonBusinessService.getMemberRegisterTagDetail(headers);
    }

    /**
     * “电子签章 - 个人认证” - 查询用户注册资料
     * @param headers Http头部信息
     * @return 查询结果
     */
    @RequestMapping(value = "/user/detail/get", method = RequestMethod.GET)
    public Wrapper<UserDetailVO> getUserDetail(@RequestHeader HttpHeaders headers) {
        return memberCommonBusinessService.getUserDetail(headers);
    }

    /**
     * 分页查询用户组织机构
     * @param headers Http头部信息
     * @return 查询结果
     */
    @RequestMapping(value = "/organization/page", method = RequestMethod.GET)
    public Wrapper<PageData<MemberOrganizationQueryVO>> pageMemberOrganizations(@RequestHeader HttpHeaders headers, OrganizationPageVO pageVO) {
        return memberCommonBusinessService.pageMemberOrganizations(headers, pageVO);
    }
}
